<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:sys="clr-namespace:System;assembly=mscorlib" >

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Shared.xaml" />
  </ResourceDictionary.MergedDictionaries>

  <!-- SimpleStyles: ToolBar -->

  <Style x:Key="ToolBarButtonBaseStyle" TargetType="{x:Type ButtonBase}">
    <Setter Property="SnapsToDevicePixels" Value="true"/>
    <Setter Property="OverridesDefaultStyle" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type ButtonBase}">
          <Border 
            x:Name="Border"  
            BorderThickness="1"
            Background="Transparent"
            BorderBrush="Transparent">
            <ContentPresenter 
              Margin="2"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              RecognizesAccessKey="True"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsKeyboardFocused" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SolidBorderBrush}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource SolidBorderBrush}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
            </Trigger>
            <Trigger Property="CheckBox.IsChecked" Value="true">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="{x:Static ToolBar.ButtonStyleKey}" 
         BasedOn="{StaticResource ToolBarButtonBaseStyle}"
         TargetType="{x:Type Button}"/>
  <Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" 
         BasedOn="{StaticResource ToolBarButtonBaseStyle}"
         TargetType="{x:Type ToggleButton}"/>
  <Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" 
         BasedOn="{StaticResource ToolBarButtonBaseStyle}"
         TargetType="{x:Type CheckBox}"/>
  <Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}"
         BasedOn="{StaticResource ToolBarButtonBaseStyle}"
         TargetType="{x:Type RadioButton}"/>

  <Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
    <Setter Property="SnapsToDevicePixels" Value="True"/>
    <Setter Property="OverridesDefaultStyle" Value="True"/>
    <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
    <Setter Property="AllowDrop" Value="true"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type TextBox}">
          <Border 
            Name="Border"
            Padding="2"
            Background="{StaticResource WindowBackgroundBrush}"
            BorderBrush="{StaticResource SolidBorderBrush}"
            BorderThickness="1" >
            <ScrollViewer Margin="0" x:Name="PART_ContentHost"/>
          </Border>
          <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
              <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
              <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
              <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

    <Style x:Key="{x:Type ToolBar}" TargetType="{x:Type ToolBar}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToolBar}">
                    <Border x:Name="Border" BorderThickness="1,0,1,1"
                    Background="{StaticResource LightBrush}" BorderBrush="{StaticResource NormalBorderBrush}">
                        <DockPanel >
                            <ToolBarPanel x:Name="PART_ToolBarPanel"
                                          IsItemsHost="true" Margin="0,1,2,2"/>
                        </DockPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="{x:Type ToolBarTray}" TargetType="{x:Type ToolBarTray}" >
    <Setter Property="Background" Value="{StaticResource HorizontalLightBrush}"/>
  </Style>
</ResourceDictionary>
